<div id="nhom_san_pham">
	<div id="danh_muc_header">
		<div class="container">
			<h1 class="row">
			<div class="span3">
				<%= image_tag "danh_muc_#{@danh_muc.slug}.png"%>
			</div>
			<div class="span9">
				<span><%= @danh_muc_ngon_ngu.ten %></span>
			</div></h1>
		</div>

	</div>
</div>

<div class="container" class="danh_muc_sp">
	<div class="row">
		<h2 class="span12"><%= t 'trang___', :trang => @trang %></h2>
	</div>
	<% i = 0 %>
	<% while i < @so_sp_moi_trang %>

	<div class="row">
		<% for j in 0..3 %>
		<% if i+ j < @san_phams.length %>
		<% sp = @san_phams[i + j]%>
		<% link_sp = url_for :action => 'index', :danh_muc_slug => sp.danh_muc.slug, :san_pham_slug => sp.slug %>
		<div class="span3 san_pham_xem_truoc">
			<div>
				<div class="hinh_anh_dai_dien">
					<a href="<%= link_sp %>"> <img class="img-rounded" src="<%= sp.hinh_anh %>" /> </a>
				</div>
				<div class="noi_dung_dai_dien">
					<a class="ten_san_pham" href="<%= link_sp %>"> <%= sp.noi_dung(@ngon_ngu, true).tieu_de %> </a>
					<br />
					<% if sp.co_khuyen_mai(Time.now) %>
					<span class="gia_san_pham gia_goc"> <strike><%= number_with_delimiter sp.gia, :delimiter => " "%> <span class="tien_te">VND</span></strike> </span>
					<br />
					<span class="gia_san_pham gia_khuyen_mai"> <%= number_with_delimiter sp.gia_khuyen_mai, :delimiter => " "%> <span class="tien_te">VND</span> </span>
					<br />
					<span class="thoi_gian_khuyen_mai"> <%= sp.khuyen_mai_bat_dau.strftime(t('dinh_dang_ngay'))%>  - <%= sp.khuyen_mai_ket_thuc.strftime(t('dinh_dang_ngay'))%></span>
					<% else %>
					<span class="gia_san_pham"> <%= number_with_delimiter sp.gia, :delimiter => " "%> <span class="tien_te">VND</span> </span>
					<% end %>
					<br />
					<a href="<%= url_for :action=>'mua_san_pham', :controller => 'gio_hang', :san_pham_id => sp.id %>" class="btn btn-info btn-small"><i class="icon-shopping-cart"></i> <%= t 'dat_hang'%></a>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
		<% end %>
		<% end %>
	</div>
	<% i += 4 %>
	<% end %>

	<div class="row">
		<div>
			<div class="span12">
				<div class="pager">
					<% if @co_trang_truoc %>
					<li class="previous">
						<a href="<%= url_for :danh_muc => params[:danh_muc], :page => @trang - 1%>">&larr; <%= t 'trang_truoc'%></a>
					</li>
					<%end %>
					<% if @co_trang_sau %>
					<li class="next">
						<a href="<%= url_for :danh_muc => params[:danh_muc], :page => @trang + 1%>"><%= t 'trang_sau'%> &rarr;</a>
					</li>
					<%end %>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
	</div>
</div>

<div>
	<%= render "shared/goi_y_caphe" %>
</div>
